package com.sky.dto;

import com.sky.entity.DishFlavor;
import com.sky.valid.AddGroup;
import com.sky.valid.UpdateGroup;
import lombok.Data;

import javax.validation.constraints.DecimalMin;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List;

@Data
public class DishDTO implements Serializable {

    @Min(value = 1, groups = {UpdateGroup.class})
    private Long id;

    //菜品名称
    @NotBlank(groups = {AddGroup.class, UpdateGroup.class})
    private String name;

    //菜品分类id
    @Min(value = 1, groups = {AddGroup.class, UpdateGroup.class})
    private Long categoryId;

    //菜品价格
    @DecimalMin(value = "0", groups = {AddGroup.class, UpdateGroup.class})
    private BigDecimal price;

    //图片
    @NotBlank(groups = {AddGroup.class, UpdateGroup.class})
    private String image;

    //描述信息
    private String description;

    //0 停售 1 起售
    private Integer status;

    //口味
    private List<DishFlavor> flavors = new ArrayList<>();

}
